<template>
  <div>
    <div class="navBar">
      <div class="left">
        <div v-if="flag">
          <span>&lt;</span>
          <span>返回</span>
        </div>
      </div>
      <div class="center">{{ text }}</div>
      <div class="right">
        <div v-if="flag2">
          <span @click="share">{{ text2 }}</span>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {};
  },
  props: {
    text: {
      type: String,
      default: "",
    },
    flag: {
      type: Boolean,
      default: false,
    },
    flag2: {
      type: Boolean,
      default: false,
    },
    text2: {
      type: String,
      default: "",
    },
  },
  created() {},
  computed: {},
  methods: {
    share() {
      this.$emit("share");
    },
  },
};
</script>
<style lang='less'  scoped>
.navBar {
  width: 100%;
  height: 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(
    to right,
    #ff0000,
    #ff4000,
    #ff8000,
    #ffc000,
    #ffff00,
    #c0ff00,
    #80ff00,
    #40ff00,
    #00ff00
  );
  .center {
    text-align: center;
    flex: 1;
  }
}
</style>
